Skip to content

Add JS code detection to prevent misuse of SimpleScript interpreter #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: Pro123
Choose a base branch
from

Conversation

SokolovskyiK
Copy link

@SokolovskyiK SokolovskyiK commented Apr 9, 2025

Summary

This PR adds a simple check to prevent confusion when users try to run valid JavaScript code like "for (let i = 0; i < 5; i++)" instead of SimpleScript syntax "for i = 1 to 5 do print(i) endfor" inside the SimpleScript editor.

What I added

  • A quick new Function(code) check inside runSimpleScript()
  • If the code is valid JS, it stops execution and shows:

    "HEY! Stop putting JS here, we are learning SimpleScript! Enter VALID SimpleScript code."

Why

There was an open issue (#1) where a user expected JS-style for loops to work. This prevents that mistake in a fun way 😄

Sorry for slightly diverging from the original task — I figured a small UX tweak like this might still be helpful for future users.

Copy link

vercel bot commented Apr 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
simple-script ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 9, 2025 7:08pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant